
module.exports = function(app) {
    return new Handler(app);
};

var Handler = function(app) {
    this.app = app;
};

// 分配一个前端服务器
Handler.prototype.getEntry = function(msg, session, next) {
	var connectorServers = this.app.getServersByType("connector");
	var connectorServer = connectorServers[Math.floor(Math.random() * connectorServers.length)];
    next(null, {code: 200, connector:{host:connectorServer.clientHost, port:connectorServer.clientPort}});
};